home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / c / sozobon / sozbin15.zoo / sozdistr / man / cat1 / cpp.1 < prev    next >
Encoding:
Text File  |  1995-04-09  |  15.0 KB  |  397 lines

  1.  
  2.  
  3.  
  4.  
  5. CPP (1)                       30 May 1993                        CPP (1)
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15. N✓NA✓AM✓ME✓E         
  16.  
  17.         cpp - a stand-alone C preprocessor 
  18.  
  19.  
  20.  
  21. S✓SY✓YN✓NO✓OP✓PS✓SI✓IS✓S         
  22.  
  23.         c✓cp✓pp✓p [ -✓-C✓CT✓TV✓V ] [ -✓-P✓P[012] ] [ -✓-D✓Dname ] 
  24.  
  25.              [ -✓-D✓Dname=✓=def ] [ -✓-I✓Idirectory ] [ -✓-U✓Uname ] 
  26.  
  27.              [ -✓-a✓an✓ns✓si✓i ] [ -✓-p✓pe✓ed✓da✓an✓nt✓ti✓ic✓c ] [ -✓-f✓f[no-]c✓c+✓++✓+-✓-c✓co✓om✓mm✓me✓en✓nt✓ts✓s ] 
  28.  
  29.              [ -✓-f✓f[no-]i✓im✓mp✓pl✓li✓ic✓ci✓it✓t-✓-n✓ne✓ew✓wl✓li✓in✓ne✓es✓s ] 
  30.  
  31.              [ -✓-W✓W[no-]b✓ba✓ad✓d-✓-c✓ch✓ha✓ar✓rs✓s ] [ -✓-W✓W[no-]n✓ne✓es✓st✓te✓ed✓d-✓-c✓co✓om✓mm✓me✓en✓nt✓ts✓s ] 
  32.  
  33.              [ -✓-W✓W[no-]b✓ba✓ad✓d-✓-c✓co✓on✓nc✓ca✓at✓t-✓-t✓to✓ok✓ke✓en✓ns✓s ] [ -✓-W✓W[no-]u✓un✓nk✓kn✓no✓ow✓wn✓n-✓-p✓pr✓ra✓ag✓gm✓ma✓a ] 
  34.  
  35.              [ i✓in✓np✓pu✓ut✓t-✓-f✓fi✓il✓le✓e [ o✓ou✓ut✓tp✓pu✓ut✓t-✓-f✓fi✓il✓le✓e ] ] 
  36.  
  37.  
  38.  
  39. D✓DE✓ES✓SC✓CR✓RI✓IP✓PT✓TI✓IO✓ON✓N         
  40.  
  41.  
  42.  
  43.         c✓cp✓pp✓p  is  a  stand-alone  C preprocessor, intended for use with C
  44.  
  45.         compilers  such  as  HSC  which  do  not  provided   access   to
  46.  
  47.         preprocessor output.  It implements translation phases 1 through 
  48.  
  49.         4  as  specified  by  the  standards document ANSI/ISO 9899-1990
  50.  
  51.         describing the  C  programming  language,  including  trigraphs,
  52.  
  53.         token pasting and stringizing.  
  54.  
  55.  
  56.  
  57.         c✓cp✓pp✓p optionally  accepts  two filenames as arguments.  i✓in✓np✓pu✓ut✓t-✓-f✓fi✓il✓le✓e
  58.  
  59.         and o✓ou✓ut✓tp✓pu✓ut✓t-✓-f✓fi✓il✓le✓e are, respectively, the input  and  output  files
  60.  
  61.         for the  preprocessor.    If  not specified, or if given as `-',
  62.  
  63.         they default to the standard  input  and  the  standard  output,
  64.  
  65.         respectively.  
  66.  
  67.  
  68.  
  69. O✓OP✓PT✓TI✓IO✓ON✓NS✓S         
  70.  
  71.  
  72.  
  73.         -✓-C✓C  
  74.  
  75.                 Pass  all  comments  (except  those  that appear on  c✓cp✓pp✓p
  76.  
  77.                 directive lines) through the preprocessor.  By  default,
  78.  
  79.                 c✓cp✓pp✓p strips out C-style comments.  
  80.  
  81.  
  82.  
  83.         -✓-P✓P[012]  
  84.  
  85.                 Preprocess  the input without producing the line control
  86.  
  87.                 information used by the next pass of the C compiler.   A
  88.  
  89.                 numeric  argument  can be passed to -P: 0 specifies that
  90.  
  91.                 no line control information control is generated, and is 
  92.  
  93.                 equivalent to -P; 1 specifies that normal  line  control
  94.  
  95.                 information  is  generated,  which is the default; and 2
  96.  
  97.                 specifies that line control information is generated  in
  98.  
  99.                 the form of preprocessor  #✓#l✓li✓in✓ne✓e directives.  
  100.  
  101.  
  102.  
  103.         -✓-T✓T  
  104.  
  105.                 Translate trigraphs in the input file.  This behavior is 
  106.  
  107.                 implied by the -✓-a✓an✓ns✓si✓i option.  
  108.  
  109.  
  110.  
  111.         -✓-D✓D name  
  112.  
  113.                 Define  n✓na✓am✓me✓e  as  1  (one).    This  is the same as if a
  114.  
  115.                 -✓-D✓Dname=✓=1✓1 option appeared on the  c✓cp✓pp✓p command line, or as 
  116.  
  117.                 if a 
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127. Tue Mar 14 00:38:45 1995                                          Page 1
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137. CPP (1)                       30 May 1993                        CPP (1)
  138.  
  139.  
  140.  
  141.  
  142.  
  143.  
  144.  
  145.          
  146.  
  147.                 #✓#d✓de✓ef✓fi✓in✓ne✓e name 1✓1 
  148.  
  149.  
  150.  
  151.          
  152.  
  153.                 line  appeared  in  the  source  file  that     c✓cp✓pp✓p   is
  154.  
  155.                 processing.  
  156.  
  157.  
  158.  
  159.         -✓-D✓Dname=✓=def  
  160.  
  161.                 Define n✓na✓am✓me✓e  as  if by a #✓#d✓de✓ef✓fi✓in✓ne✓e directive.  This is the
  162.  
  163.                 same as if a 
  164.  
  165.  
  166.  
  167.          
  168.  
  169.                 #✓#d✓de✓ef✓fi✓in✓ne✓e name d✓de✓ef✓f 
  170.  
  171.  
  172.  
  173.          
  174.  
  175.                 line  appeared  in  the  source  file  that     c✓cp✓pp✓p   is
  176.  
  177.                 processing.  The -✓-D✓D option has lower precedence than the 
  178.  
  179.                 -✓-U✓U  option;  that is, if the same name is used in both a
  180.  
  181.                 -✓-U✓U option and a -✓-D✓D option, the name  will  be  undefined
  182.  
  183.                 regardless of the order of the options.  
  184.  
  185.  
  186.  
  187.         -✓-I✓Idirectory  
  188.  
  189.                 Insert    d✓di✓ir✓re✓ec✓ct✓to✓or✓ry✓y  into  the  search path for #✓#i✓in✓nc✓cl✓lu✓ud✓de✓e
  190.  
  191.                 files with names not beginning with `/✓/', `\✓\´, or a drive 
  192.  
  193.                 specifier.  d✓di✓ir✓re✓ec✓ct✓to✓or✓ry✓y is inserted ahead of the  standard
  194.  
  195.                 list of  ``include''  directories.  Thus, #✓#i✓in✓nc✓cl✓lu✓ud✓de✓e files
  196.  
  197.                 with names enclosed in double-quotes  ("✓")  are  searched
  198.  
  199.                 for first in the directory of the file with the #✓#i✓in✓nc✓cl✓lu✓ud✓de✓e 
  200.  
  201.                 line,  then  in  directories  named with -✓-I✓I options, and
  202.  
  203.                 lastly, in directories from  the  standard  list.    For
  204.  
  205.                 #✓#i✓in✓nc✓cl✓lu✓ud✓de✓e  files  with  names  enclosed in angle-brackets
  206.  
  207.                 (<✓<>✓>), the directory of the file with the  #✓#i✓in✓nc✓cl✓lu✓ud✓de✓e  line
  208.  
  209.                 is not  searched.   See U✓US✓SA✓AG✓GE✓E below for exact details of
  210.  
  211.                 this search order.  
  212.  
  213.  
  214.  
  215.         -✓-S✓S[filename]  
  216.  
  217.                 Specify an alternate configuration file.  If f✓fi✓il✓le✓en✓na✓am✓me✓e is 
  218.  
  219.                 present, the specified  file  is  read  instead  of  the
  220.  
  221.                 default  configuration  file; if f✓fi✓il✓le✓en✓na✓am✓me✓e is absent, the
  222.  
  223.                 default configuration file is  simply  not  read.    See
  224.  
  225.                 U✓US✓SA✓AG✓GE✓E below for further details.  
  226.  
  227.  
  228.  
  229.         -✓-U✓Uname  
  230.  
  231.                 Remove  any  initial definition of n✓na✓am✓me✓e, where n✓na✓am✓me✓e is a
  232.  
  233.                 symbol that is predefined by the preprocessor.  
  234.  
  235.  
  236.  
  237.         -✓-V✓V  
  238.  
  239.                 Print version information to s✓st✓td✓de✓er✓rr✓r. 
  240.  
  241.  
  242.  
  243.         -✓-a✓an✓ns✓si✓i  
  244.  
  245.                 Define the preprocessor token _✓__✓_S✓ST✓TD✓DC✓C_✓__✓_ to have value  1,
  246.  
  247.                 and enable   trigraph  translation.    To  get  _✓__✓_S✓ST✓TD✓DC✓C_✓__✓_
  248.  
  249.                 without  trigraph  translation,  you  can  specify   the
  250.  
  251.                 options -✓-a✓an✓ns✓si✓i -✓-T✓T. 
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259. Tue Mar 14 00:38:45 1995                                          Page 2
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269. CPP (1)                       30 May 1993                        CPP (1)
  270.  
  271.  
  272.  
  273.  
  274.  
  275.  
  276.  
  277.         -✓-p✓pe✓ed✓da✓an✓nt✓ti✓ic✓c  
  278.  
  279.                 Issue  warnings  for  constructs which, while recognized
  280.  
  281.                 and accepted by most  preprocessors,  are  not  strictly
  282.  
  283.                 allowed by   the   ANSI/ISO  standard.    Currently  the
  284.  
  285.                 following such constructs are recognized: 
  286.  
  287.  
  288.  
  289.          
  290.  
  291.                 *  Numeric  tokens  which  fall   afoul   of   the   new
  292.  
  293.                 `preprocessing  number'  definition  in  ANSI/ISO 6.1.8,
  294.  
  295.                 such as `0x123e+1'. With or without -✓-p✓pe✓ed✓da✓an✓nt✓ti✓ic✓c, c✓cp✓pp✓p  will
  296.  
  297.                 immediately   retokenize  the  offending  token  in  the
  298.  
  299.                 expected manner.  
  300.  
  301.  
  302.  
  303.         The following -✓-f✓f and -✓-W✓W options can be negated by adding  a  n✓no✓o-✓-
  304.  
  305.         before the option name.  Some are on by default.  
  306.  
  307.  
  308.  
  309.         -✓-f✓fc✓c+✓++✓+-✓-c✓co✓om✓mm✓me✓en✓nt✓ts✓s  
  310.  
  311.                 Support the C++ comment indicator `/✓//✓/´. With this option 
  312.  
  313.                 active,  everything  on the line after the /✓//✓/ is treated
  314.  
  315.                 as a comment.  Off by default.  
  316.  
  317.  
  318.  
  319.         -✓-f✓fi✓im✓mp✓pl✓li✓ic✓ci✓it✓t-✓-n✓ne✓ew✓wl✓li✓in✓ne✓es✓s  
  320.  
  321.                 Allow string literals to have embedded newlines,  as  in
  322.  
  323.                 the following example: 
  324.  
  325.                 
  326.                     "this is an
  327.                      example"
  328.                 
  329.                 This  option  allows  c✓cp✓pp✓p to be used on code written for
  330.  
  331.                 certain rather irritatingly  nonstandard  compilers  (we
  332.  
  333.                 won't mention GCC's name...).  Off by default.  
  334.  
  335.  
  336.  
  337.         -✓-W✓Wb✓ba✓ad✓d-✓-c✓ch✓ha✓ar✓rs✓s  
  338.  
  339.                 Issue  a  warning  if  a  character  that cannot legally
  340.  
  341.                 appear in a C program appears  in  the  input.    On  by
  342.  
  343.                 default.  
  344.  
  345.  
  346.  
  347.         -✓-W✓Wn✓ne✓es✓st✓te✓ed✓d-✓-c✓co✓om✓mm✓me✓en✓nt✓ts✓s  
  348.  
  349.                 Issue  a  warning  if a comment-start character sequence
  350.  
  351.                 (`/✓/*✓*´, and `/✓//✓/´ if -✓-f✓fc✓c+✓++✓+-✓-c✓co✓om✓mm✓me✓en✓nt✓ts✓s is active) appears  in
  352.  
  353.                 a comment.  Off by default.  
  354.  
  355.  
  356.  
  357.         -✓-W✓Wb✓ba✓ad✓d-✓-c✓co✓on✓nc✓ca✓at✓t-✓-t✓to✓ok✓ke✓en✓ns✓s  
  358.  
  359.                 Issue  a  warning if the token concatenation operator ##
  360.  
  361.                 produces an illegal C token.  On by default.  
  362.  
  363.  
  364.  
  365.         -✓-W✓Wu✓un✓nk✓kn✓no✓ow✓wn✓n-✓-p✓pr✓ra✓ag✓gm✓ma✓a  
  366.  
  367.                 Issue  a  warning  if  the  input  contains  a   #✓#p✓pr✓ra✓ag✓gm✓ma✓a
  368.  
  369.                 directive that c✓cp✓pp✓p does not recognize.  Off by default.  
  370.  
  371.  
  372.  
  373.         Options  beginning with -✓-X✓X are for specialized interactions with
  374.  
  375.         particular programs,  and  should    not  generally  be  invoked
  376.  
  377.         directly by  the user.  The following such options are currently
  378.  
  379.         recognized: 
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387. Tue Mar 14 00:38:45 1995                                          Page 3
  388.  
  389.  
  390.  
  391.  
  392.  
  393.  
  394.  
  395.  
  396.  
  397. CPP (1)                       30 May 1993                        CPP (1)
  398.  
  399.  
  400.  
  401.  
  402.  
  403.  
  404.  
  405.         -✓-X✓Xf✓fl✓lu✓uf✓ff✓f  
  406.  
  407.                 This  option  is  used  by  the  f✓fl✓lu✓uf✓ff✓f(1)  source   code
  408.  
  409.                 checker.   It causes the preprocessor token _✓__✓_F✓FL✓LU✓UF✓FF✓F_✓__✓_ to
  410.  
  411.                 be defined, and enables certain related  pragmas.    See
  412.  
  413.                 the f✓fl✓lu✓uf✓ff✓f(1) documentation for further information.  
  414.  
  415.  
  416.  
  417. U✓US✓SA✓AG✓GE✓E         
  418.  
  419.         If  you  are  familiar with C, you should already know about the
  420.  
  421.         basic  workings  of  c✓cp✓pp✓p.  We  will  not  go  into  a   detailed
  422.  
  423.         description  here,  since  any  good  book on C could do better;
  424.  
  425.         instead,  we  will   describe   details   particular   to   this
  426.  
  427.         implementation.  
  428.  
  429.  
  430.  
  431.         Directory Search Order         
  432.  
  433.  
  434.  
  435.  
  436.  
  437.         A  file  specified in an #✓#i✓in✓nc✓cl✓lu✓ud✓de✓e directive will be searched for
  438.  
  439.         in the following directories, in order: 
  440.  
  441.  
  442.  
  443.         1.  
  444.  
  445.                 The directory of the file that contains  the    #✓#i✓in✓nc✓cl✓lu✓ud✓de✓e
  446.  
  447.                 directive,  if  the  directive  is of the form `#✓#i✓in✓nc✓cl✓lu✓ud✓de✓e
  448.  
  449.                 "filename"'.  
  450.  
  451.  
  452.  
  453.         2.  
  454.  
  455.                 The directories specified by -✓-I✓I options,  in  the  order
  456.  
  457.                 they were specified.  
  458.  
  459.  
  460.  
  461.         3.  
  462.  
  463.                 The   list  of  directories  specified  in  the  I✓IN✓NC✓CL✓LU✓UD✓DE✓E
  464.  
  465.                 environment variable, in order.  
  466.  
  467.  
  468.  
  469.         Special Names         
  470.  
  471.  
  472.  
  473.  
  474.  
  475.         The following macros are predefined by c✓cp✓pp✓p: 
  476.  
  477.  
  478.  
  479.         _✓__✓_S✓ST✓TD✓DC✓C_✓__✓_  
  480.  
  481.                 Expands to 1 if the -✓-a✓an✓ns✓si✓i option is specified.  
  482.  
  483.  
  484.  
  485.         _✓__✓_L✓LI✓IN✓NE✓E_✓__✓_  
  486.  
  487.                 Expands to an integer constant representing the  current
  488.  
  489.                 line number in the current input file.  
  490.  
  491.  
  492.  
  493.         _✓__✓_F✓FI✓IL✓LE✓E_✓__✓_  
  494.  
  495.                 Expands  to  a  string constant representing the name of
  496.  
  497.                 the current input file.  
  498.  
  499.  
  500.  
  501.         _✓__✓_D✓DA✓AT✓TE✓E_✓__✓_  
  502.  
  503.                 Expands to a string constant of the form "Mmm  dd  yyyy"
  504.  
  505.                 representing   the   date  on  which  preprocessing  was
  506.  
  507.                 initiated.  
  508.  
  509.  
  510.  
  511.         _✓__✓_T✓TI✓IM✓ME✓E_✓__✓_  
  512.  
  513.  
  514.  
  515.  
  516.  
  517.  
  518.  
  519. Tue Mar 14 00:38:45 1995                                          Page 4
  520.  
  521.  
  522.  
  523.  
  524.  
  525.  
  526.  
  527.  
  528.  
  529. CPP (1)                       30 May 1993                        CPP (1)
  530.  
  531.  
  532.  
  533.  
  534.  
  535.  
  536.  
  537.                 Expands to a string  constant  of  the  form  "hh:mm:ss"
  538.  
  539.                 representing  the system time at which preprocessing was
  540.  
  541.                 initiated.  
  542.  
  543.  
  544.  
  545.         Configuration files         
  546.  
  547.  
  548.  
  549.  
  550.  
  551.         c✓cp✓pp✓p uses a configuration file to set up site-specific predefined 
  552.  
  553.         macros.  By  default,  the  directories  specified  in  the  L✓LI✓IB✓B
  554.  
  555.         environment   variable  are  searched  in  order  for  the  file
  556.  
  557.         c✓cp✓pp✓p_✓_d✓de✓ef✓fs✓s.✓.h✓h; an alternate file can be specified from the  command
  558.  
  559.         line with the -✓-S✓S option.  
  560.  
  561.  
  562.  
  563.         The  configuration  file  is read just like a normal input file,
  564.  
  565.         except that text  other  than  preprocessor  directives  is  not
  566.  
  567.         passed through  to  the output file.  Normally the configuration
  568.  
  569.         file will contain only comments and preprocessor directives.  In 
  570.  
  571.         addition,  two  special  pragmas  are  recognized   within   the
  572.  
  573.         configuration file only: 
  574.  
  575.  
  576.  
  577.         #pragma CPP_cmdline_arg o✓op✓pt✓ti✓io✓on✓n  
  578.  
  579.                 The  single  token  o✓op✓pt✓ti✓io✓on✓n is processed as though it had
  580.  
  581.                 appeared as a command-line option.  The  option  may  be
  582.  
  583.                 undone  from  the  command  line,  except  as  indicated
  584.  
  585.                 below.  
  586.  
  587.  
  588.  
  589.         #pragma CPP_delayed  
  590.  
  591.                 Normally, the configuration  file  is  processed  before
  592.  
  593.                 command-line   options   are  processed,  to  allow  the
  594.  
  595.                 commands  therein  to  be  overridden  by   command-line
  596.  
  597.                 options.   This  pragma  causes  the  command line to be
  598.  
  599.                 processed before the remainder  of  the  file,  allowing
  600.  
  601.                 conditional  setup  based  on  parameters  set  from the
  602.  
  603.                 command line.    Note   that   macro   definitions   and
  604.  
  605.                 command-line   specifications  made  after  this  pragma
  606.  
  607.                 cannot be undone from the command line.  
  608.  
  609.  
  610.  
  611.         For example, the  following  configuration  file  activates  C++
  612.  
  613.         comments  by  default,  and sets the macro _✓_P✓PR✓RO✓OT✓TO✓O(✓()✓) according to
  614.  
  615.         the presence of the -✓-a✓an✓ns✓si✓i option: 
  616.  
  617.         
  618.             #pragma CPP_cmdline_arg -fc++-comments
  619.             #pragma CPP_delayed
  620.             #ifdef __STDC__
  621.             #  define _PROTO(x) x
  622.             #else
  623.             #  define _PROTO(x) ()
  624.             #endif
  625.         
  626.  
  627.  
  628. S✓SE✓EE✓E A✓AL✓LS✓SO✓O        
  629.  
  630.         f✓fl✓lu✓uf✓ff✓f(1) 
  631.  
  632.  
  633.  
  634.         Documentation for your C compiler 
  635.  
  636.  
  637.  
  638.  
  639.  
  640.  
  641.  
  642. Tue Mar 14 00:38:45 1995                                          Page 5
  643.  
  644.  
  645.  
  646.  
  647.  
  648.  
  649.  
  650.  
  651.  
  652. CPP (1)                       30 May 1993                        CPP (1)
  653.  
  654.  
  655.  
  656.  
  657.  
  658.  
  659.  
  660.         Any good book on C.  
  661.  
  662.  
  663.  
  664. D✓DI✓IA✓AG✓GN✓NO✓OS✓ST✓TI✓IC✓CS✓S         
  665.  
  666.  
  667.  
  668.         The  error  messages  produced  by  c✓cp✓pp✓p  are  intended   to   be
  669.  
  670.         self-explanatory.   The line number and filename where the error
  671.  
  672.         occurred are printed along with the diagnostic.  
  673.  
  674.  
  675.  
  676. B✓BU✓UG✓GS✓S         
  677.  
  678.         None that I know of, but there's almost always One More Bug(TM). 
  679.  
  680.         If you should find one, please report it to me, Scott Bigham, at 
  681.  
  682.         dsb@cs.duke.edu.  
  683.  
  684.  
  685.  
  686.  
  687.  
  688.  
  689.  
  690.  
  691.  
  692.  
  693.  
  694.  
  695.  
  696.  
  697.  
  698.  
  699.  
  700.  
  701.  
  702.  
  703.  
  704.  
  705.  
  706.  
  707.  
  708.  
  709.  
  710.  
  711.  
  712.  
  713.  
  714.  
  715.  
  716.  
  717.  
  718.  
  719.  
  720.  
  721.  
  722.  
  723.  
  724.  
  725.  
  726.  
  727.  
  728.  
  729.  
  730.  
  731.  
  732.  
  733.  
  734.  
  735.  
  736.  
  737.  
  738.  
  739.  
  740.  
  741.  
  742.  
  743.  
  744.  
  745.  
  746.  
  747.  
  748.  
  749.  
  750.  
  751.  
  752.  
  753.  
  754.  
  755.  
  756.  
  757.  
  758.  
  759.  
  760.  
  761.  
  762.  
  763.  
  764.  
  765.  
  766.  
  767.  
  768.  
  769.  
  770.  
  771.  
  772.  
  773.  
  774. Tue Mar 14 00:38:45 1995                                          Page 6
  775.  
  776.  
  777.  
  778.  
  779.  
  780.